Don't rename/free posnfilenametmp if we're not in tracking mode.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 19 Oct 2006 14:54:24 +0000 (14:54 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 19 Oct 2006 14:54:24 +0000 (14:54 +0000)
git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@2410 f51c46e8-681c-474f-0cfe-069cfd0219fb

gpsbabel/kml.c

index 55ed3f56c0f83ac455c05be78c888a8fbfed7fcc..3d6f947651b2f95b67051c4f594d78840b248f81 100644 (file)
@@ -276,8 +276,12 @@ static void
 kml_wr_deinit(void)
 {
        fclose(ofd);
-       rename(posnfilenametmp, posnfilename);
-       xfree(posnfilenametmp);
+
+       if (posnfilenametmp) {
+               rename(posnfilenametmp, posnfilename);
+               xfree(posnfilenametmp);
+               posnfilenametmp = NULL;
+       }
        ofd = NULL;
 }